import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path: '/',
    redirect:'/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import(/* webpackChunkName: "home" */ '../views/home/home.vue'),
    children:[{
      path: '/home/list',
      name: 'List',
      component: () => import(/* webpackChunkName: "list" */ '../views/home/list/list.vue'),
    },{
      path: '/home/huo',
      name: 'Huo',
      component: () => import(/* webpackChunkName: "huo" */ '../views/home/huo/huo.vue'),
    },]
  },
  {
    path: '/shan',
    name: 'Shan',
    component: () => import(/* webpackChunkName: "shan" */ '../views/shan/shan.vue'),
  },
  {
    path: '/dan',
    name: 'Dan',
    component: () => import(/* webpackChunkName: "dan" */ '../views/dan/dan.vue'),
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
